import { createSlice } from "@reduxjs/toolkit";
const baseSlice = createSlice({
    name: 'base',
    initialState: {
        currentRouteName: sessionStorage.getItem('title') || '仪表盘'
    },
    reducers: {
        SETCURRENTROUTE(state, action) {
            state.currentRouteName = action.payload;
            sessionStorage.setItem('title', state.currentRouteName)
        }
    }
})
export const { SETCURRENTROUTE } = baseSlice.actions;
export default baseSlice.reducer;